#pragma once
#include "View.h"

class Button;
class ColorAnimation;
class ButtonListener
{
public:
	ButtonListener() { }
	~ButtonListener() { }

protected:
	friend class Button;

	virtual void ButtonPressed(Button* sender, MouseEvent& event) = 0;

};

class Button : public View
{
public:
	enum STATUS
	{
		STATUS_NORMAL,
		STATUS_CHECKED,
	};
	Button(View* parent, ButtonListener* listener);
	virtual ~Button();

	virtual bool isLockFocus() { return false; }

	virtual void setStatus(STATUS status);
	virtual STATUS getStatus();

	virtual void changeTo3Model(bool is3Model);
	virtual bool is3Model();

	virtual void mouseEntry();

	virtual void mouseLeave();

protected:
	virtual bool paint(SkCanvas* canvas);

	virtual bool paintBackground(SkCanvas* canvas);

	virtual bool paintFrontground(SkCanvas* canvas);

	virtual bool paintBorder(SkCanvas* canvas);

	virtual bool paintFocus(SkCanvas* canvas);

	virtual bool processMouseEvent(MouseEvent& event);

private:
	ButtonListener* m_buttonListener;

	bool mouse_hover_;
	bool pressing_;
	// ColorAnimation anmation_;

	STATUS button_status_; // button status : normal , checked
	bool is_3_model_;


};

